home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -websites- / haage&partner / ftp / classx / fm3-demo.lha / FM3-DEMO / Rexx / TUT_FontGroviera.rexx < prev    next >
OS/2 REXX Batch file  |  1997-08-29  |  4KB  |  161 lines

  1. /******************************************************************/
  2. /* ClassX Amiga Rexx script - Copyright © 1997 ClassX Development */
  3. /******************************************************************/
  4.  
  5. /*
  6.     $VER: TUT_FontGroviera.rexx 3.0
  7. */
  8.  
  9. /*
  10. #ITA "Tutorial Font Groviera"
  11. #INF "Esempio guidato interattivo per la"
  12. #INF "creazione di un font in stile Groviera."
  13. #END
  14. */
  15.  
  16. /*
  17. #ENG "Tutorial Cheesy Font"
  18. #INF "Interactive guided example to"
  19. #INF "create a cheese-looking font."
  20. #END
  21. */
  22.  
  23.  
  24. MYPORT = 'FontMachine'
  25.  
  26. IF ~SHOW('P', MYPORT) THEN DO
  27.     IF EXISTS('FontMachine:FontMachine') THEN DO
  28.         ADDRESS COMMAND 'Run >NIL: FontMachine:FontMachine'
  29.         DO 30 WHILE ~SHOW('P',MYPORT)
  30.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  31.         END
  32.     END
  33.     ELSE DO
  34.         SAY "FontMachine could not be loaded."
  35.         EXIT 10
  36.     END
  37. END
  38.  
  39. IF ~SHOW('P', MYPORT) THEN DO
  40.     SAY 'FontMachine Rexx port could not be opened.'
  41.     EXIT 10
  42. END
  43.  
  44. ADDRESS VALUE MYPORT
  45. OPTIONS RESULTS
  46. OPTIONS FAILAT 10000
  47.  
  48. /* Make sure rexxsupport library is opened */
  49. IF ~SHOW('L','rexxsupport.library') THEN CALL ADDLIB('rexxsupport.library',0,-30)
  50.  
  51. /******************************************************************/
  52.  
  53. /* language support */
  54.  
  55. LockGui
  56. GetLocale
  57.  
  58. Select 
  59.     /* italiano */
  60.     when FM_RESULT = "ITA" then do
  61.         TXT_01 = '"Tutorial: come costruire un font stile Groviera"'
  62.         TXT_02 = '"Risoluzione 8 colori"'
  63.         TXT_03 = '"Caricare font Balloon di 100 punti"'
  64.         TXT_04 = '"Tessitura di fronte Brush:Groviera"'
  65.         TXT_05 = '"Settaggio palette appropriata"'
  66.         TXT_06 = '"Settare mappatura tessiture a RndMap (mappatura casuale)"'
  67.         TXT_07 = '"Settare uno Sbalzo di 3 punti, parte illuminata Alto-Sinistra"'
  68.         TXT_08 = '"Settare un Ombra di 8 punti, posizione Basso-Destra"'
  69.         TXT_09 = '"Pronto ! Vuoi salvare il ColorFont ?"'
  70.         TXT_10 = '"Ok|Annulla"'
  71.         TXT_11 = '"Fine Tutorial"'
  72.     end
  73.  
  74.     /* english or default language */
  75.     when FM_RESULT = "ENG" then do
  76.         TXT_01 = '"Tutorial: how to make a Cheesy font"'
  77.         TXT_02 = '"Set resolution to 8 colours"'
  78.         TXT_03 = '"Load font Balloon, 100 points"'
  79.         TXT_04 = '"Load front texture Brush:Groviera"'
  80.         TXT_05 = '"Set the appropriate cheesy palette"'
  81.         TXT_06 = '"Set texture mapping to RndMap (random mapping)"'
  82.         TXT_07 = '"Set the Emboss attribute to 3 pixels, lighted Up-Left"'
  83.         TXT_08 = '"Set the Shadow attirbute to 8 pixels, direction Down-Right"'
  84.         TXT_09 = '"Ready. Do you want to save the ColorFont ?"'
  85.         TXT_10 = '"Ok|Cancel"'
  86.         TXT_11 = '"End Tutorial"'
  87.     end
  88. end
  89.  
  90.  
  91. FreeTexture FRONT
  92. FreeTexture BORDER
  93. SetAttr "Emboss" 0
  94. SetAttr "Bevel" 0
  95. SetAttr "3D" 0
  96. SetAttr "Shadow" 0
  97. SetAttr "Outline" 0
  98. SetAttr "OutTexture" 0
  99.  
  100. Request '"FontMachine"' TXT_01 'Ok'
  101. Request '"FontMachine"' TXT_02 'Ok'
  102. Resolution 3
  103.  
  104. Request '"FontMachine"' TXT_03 'Ok'
  105. LoadFont "Balloon.font" 100
  106. CALL WaitRedraw (FM_RESULT)
  107.  
  108. Request '"FontMachine"' TXT_04 'Ok'
  109. LoadTexture "Front" "Brush" "FontMachine:Brush/Groviera"
  110. CALL WaitRedraw (FM_RESULT)
  111.  
  112. Request '"FontMachine"' TXT_05 'Ok'
  113. EditPal 1 0 0 0
  114. EditPal 2 72 33 0 
  115. EditPal 3 145 67 0
  116. EditPal 4 217 100 0
  117. EditPal 5 221 121 0
  118. EditPal 6 222 140 0
  119. EditPal 7 223 159 0
  120. CALL WaitRedraw (FM_RESULT)
  121.  
  122. Request '"FontMachine"' TXT_06 'Ok'
  123. SetMapMode "MappedRnd"
  124. CALL WaitRedraw (FM_RESULT)
  125.  
  126. Request '"FontMachine"' TXT_07 'Ok'
  127. SetAttr "Emboss" 3 "UL"
  128. CALL WaitRedraw (FM_RESULT)
  129.  
  130. Request '"FontMachine"' TXT_08 'Ok'
  131. SetAttr "Shadow" 8 "DR" 1
  132. CALL WaitRedraw (FM_RESULT)
  133.  
  134. Request '"FontMachine"' TXT_09 TXT_10
  135. IF (FM_RESULT) THEN DO    
  136.     SaveFont "Fonts:BalloonC" "108.8C"
  137.     IF (RC) THEN DO
  138.         Request '"ARexx Error"' '"'FM_ERROR'"' 'Ok'
  139.     END
  140.     CALL WaitRedraw (FM_RESULT)
  141. END
  142.  
  143. Request '"FontMachine"' TXT_11 'Ok'
  144.  
  145. UnLockGui
  146. EXIT
  147.  
  148. /******************************************************************/
  149.  
  150. WaitRedraw:
  151.     ARG Res
  152.     /* wait the rendering of the font */
  153.     DO WHILE Res ~= 0
  154.         CheckRedraw
  155.         Res = FM_RESULT
  156.         ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  157.     END
  158.     RETURN
  159.  
  160. /******************************************************************/
  161.